/*     */ package com.newcrm.webapi;
/*     */ 
/*     */ import com.newcrm.exception.NotFoundException;
/*     */ import com.newcrm.util.ParameterUtil;
/*     */ import com.newcrm.util.Util;
/*     */ import com.newcrm.webapi.sub.AddUser;
/*     */ import com.newcrm.webapi.sub.ChangeUserMaxCompanyNum;
/*     */ import com.newcrm.webapi.sub.ChangeUserOwner;
/*     */ import com.newcrm.webapi.sub.CheckEmailSetting;
/*     */ import com.newcrm.webapi.sub.CheckUserId;
/*     */ import com.newcrm.webapi.sub.DeleteUser;
/*     */ import com.newcrm.webapi.sub.DeleteVOIPSetting;
/*     */ import com.newcrm.webapi.sub.ListUsers;
/*     */ import com.newcrm.webapi.sub.ShowAddUser;
/*     */ import com.newcrm.webapi.sub.ShowUpdateUser;
/*     */ import com.newcrm.webapi.sub.UpdateUser;
/*     */ import com.newcrm.webapi.sub.UpdateUserExtInfo;
/*     */ import com.newcrm.webapi.sub.UpdateVOIPSetting;
/*     */ import java.io.IOException;
/*     */ import javax.servlet.RequestDispatcher;
/*     */ import javax.servlet.ServletConfig;
/*     */ import javax.servlet.ServletContext;
/*     */ import javax.servlet.ServletException;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ 
/*     */ public class Users extends AbstractHttpServlet
/*     */ {
/*     */   private static final long serialVersionUID = 376252511489813301L;
/*     */ 
/*     */   public void doGet(HttpServletRequest request, HttpServletResponse response)
/*     */     throws ServletException, IOException
/*     */   {
/*  46 */     if (!checkLogin(request)) {
/*  47 */       super.showLoginPage(request, response);
/*  48 */       return;
/*     */     }
/*     */ 
/*  51 */     String url = request.getRequestURI();
/*  52 */     String[] param = ParameterUtil.getParameters(url, getTagkey());
/*     */     try {
/*  54 */       String operation = Util.getURLParameter(request
/*  55 */         .getParameter("operation"));
/*  56 */       if (((param == null) || (param.length == 0)) && (
/*  57 */         (operation == null) || (operation.trim().length() == 0))) {
/*  58 */         new ListUsers(this).parse(request, response);
/*  59 */         return;
/*     */       }
/*     */ 
/*  63 */       if ((param != null) && (param.length == 1)) {
/*  64 */         if ("add".equals(param[0])) {
/*  65 */           String path = getServletConfig().getServletContext()
/*  66 */             .getRealPath("images/upload/identity/");
/*  67 */           new AddUser(this, path).parse(request, response);
/*  68 */           return;
/*     */         }
/*     */ 
/*  71 */         if ("checkUserId".equals(param[0])) {
/*  72 */           new CheckUserId(this).parse(request, response);
/*  73 */           return;
/*     */         }
/*     */ 
/*  77 */         if ("changeMaxCompanyNum".equals(param[0])) {
/*  78 */           new ChangeUserMaxCompanyNum(this).parse(request, response);
/*  79 */           return;
/*     */         }
/*     */ 
/*  83 */         if ("changeUserOwner".equals(param[0])) {
/*  84 */           String path = getServletConfig().getServletContext()
/*  85 */             .getRealPath("lucene/");
/*  86 */           new ChangeUserOwner(this, path).parse(request, response);
/*  87 */           return;
/*     */         }
/*     */ 
/*     */       }
/*     */ 
/*  92 */       if ((param != null) && (param.length == 2)) {
/*  93 */         if ("emailsetting".equals(param[1])) {
/*  94 */           new CheckEmailSetting(this, param[0]).parse(request, 
/*  95 */             response);
/*  96 */           return;
/*     */         }
/*     */ 
/*  99 */         if ("voip".equals(param[1])) {
/* 100 */           new UpdateVOIPSetting(this, param[0]).parse(request, 
/* 101 */             response);
/* 102 */           return;
/*     */         }
/*     */ 
/* 105 */         if ("deleteVoip".equals(param[1])) {
/* 106 */           new DeleteVOIPSetting(this, param[0]).parse(request, 
/* 107 */             response);
/* 108 */           return;
/*     */         }
/*     */ 
/* 111 */         if ("extInfo".equals(param[1])) {
/* 112 */           new UpdateUserExtInfo(this, param[0]).parse(request, 
/* 113 */             response);
/* 114 */           return;
/*     */         }
/*     */       }
/*     */     } catch (NotFoundException e) {
/* 118 */       request.getRequestDispatcher("/errorpage.jsp").forward(request, 
/* 119 */         response);
/*     */ 
/* 121 */       super.doGet(request, response);
/*     */     }
/*     */   }
/*     */ 
/*     */   protected AbstractAction getAddAction() {
/* 126 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getDeleteAction(String id)
/*     */   {
/* 131 */     return new DeleteUser(this, id);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getListAction()
/*     */   {
/* 136 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAction(String id)
/*     */   {
/* 141 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAddPageAction()
/*     */   {
/* 146 */     return new ShowAddUser(this);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowConfirmDestroyAction(String id)
/*     */   {
/* 151 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowUpdatePageAction(String id)
/*     */   {
/* 156 */     return new ShowUpdateUser(this, id);
/*     */   }
/*     */ 
/*     */   protected String getTagkey()
/*     */   {
/* 161 */     return "/users";
/*     */   }
/*     */ 
/*     */   protected AbstractAction getUpdateAction(String id)
/*     */   {
/* 166 */     return new UpdateUser(this, id);
/*     */   }
/*     */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.Users
 * JD-Core Version:    0.6.1
 */